import {
  Column,
  Entity,
} from 'typeorm'

import { CommonEntity } from '~/common/entity/common.entity'
import { CClassStatus } from '../constant'

@Entity({ name: 'c_class' })
export class ClassEntity extends CommonEntity {
  @Column({ name: 'class_id', unique: true })
  classId: string

  @Column({ name: 'class_name' })
  className: string

  @Column({ name: 'class_grade', comment: '班级学级，0 幼儿园，1-6 小学，7-8 初中', default: 0 })
  classGrade: number

  @Column({ name: 'class_teacher', comment: '带班老师' })
  classTeacher: number

  @Column({ name: 'start_at', type: 'datetime', nullable: true, comment: '开始时间' })
  startAt: Date

  @Column({ name: 'expire_at', type: 'datetime', nullable: true, comment: '毕业时间' })
  expireAt: Date

  @Column({ comment: '状态', default: 1 })
  status: CClassStatus
  
  @Column({ name: 'study_plan', type: 'text', nullable: true, comment: '学习计划' })
  studyPlan: string
}